simplify and cleanup login