Refactor test code into separate headers/classes