Refactored into nested class (testing)