Split out material scoring into separate function.