Refactored and changed materialField logic