Minor refactor, added login tests