Added support for retrieving spotify token and refactoring