Refactor testing files