login code clean