code refactoring for auth implementation
modified some views