Move utility code to separate file: util.rb