refactored parse.rb