clean code for login