Can these gon setting calls be moved into a before_filter? See e.g. the get_settings method on ApplicationController.