nxengine refactoring