simplify engine.rb