refactored user class to ActiveRecord