Refactor login

Refactor login functionality into Mixins