Refactoring login method and renaming table to users in model