refactor helpers.rb