refactoring locationmanager, token, etc