Engine code cleanup