Refactored devise.rb