Refactor shape tests