rewrite/refactoring tests