type -> engine, engine can be function