refactoring
more authentication implemented