consolidate base_controller.rb