Refactor engine material loading.