AS make login code into module