refactor tests to be more modular