40s not bad mileage to get, but is low for that bike. If you're not sure on maintenance, a full maintenance service might be due, air filter, oil/filter, spark plugs, tire pressure, etc. Get a service manual (available on the Internets), check daily maintenance checks, and mileage/annual service intervals and make sure everything's up to snuff.
If it's not a maintenance issue, your weight can affect that bike drastically. If you're a heavier person, that could be what's making the difference. Riding habits can also affect mileage.
Aftermarket mods could make a difference too. Depending on if the bike has mods, as you mention a change in final drive ratio, make sure you understand how these changes/modifications affect fuel mileage vs. a stock bike.