Organized code

Refactored some stuff and added a locationhelper for all the location
code.