Made little more flexible - hash replaced with ActiveSupport::HashWithIndifferentAccess