move changes to logic.rb