define a unified BaseUser module in lib/base_user.rb