refactored test class