Refactored authentication and separated accounts from users