refactored code and move gps/db/net code to LocationService and NetworkService