improving and refactoring tests according to Dominic's notes