Refactored Authorization service

Just a little refactorization to the authorization service. More to come...