refactoring login and resume actions