more work refactoring types for engine code and simplifying the components