revamp login code