Refactor initializtion process & token handling