move type checking conditions up top
fix function name
move Hat model setup to beforeEach