Refactor Test class