moved some stuff into engine and inline files