Rewrite of engine