Refactor engine. Change build - create function.