refactored Test class