Refactor utility methods to profiles.rb