refactor profile.rb