Refactoring test methods in main class