add login, clean code