hats as classes
simplification