Refactored login logic using RACCommand