refactor login controller to new module pattern