refactor code in pollination.rb to make more readable