Refactor populate_handles method in modifiers.rb

I replaced a piece of code with simple line and moved some logic in a private method.