Moved common methods to util.rb file