refactoring the platform core engine