Moved all generic code to common.rb