modularizing login