refactor problem.rb