Moved the race and class logic out of the fragments