refactor portfolio.rb