This should move to utils.rb