Started refactoring material application