Refactoring; add OAuth Bearer token-based authentication