More homogeny, less duplication, style fixes

remove unnecessary includes and properly calculate purchase amounts