Cleaning code for PE12 in Ruby