Minor refactoring and clean up, added login flash