Refactored solution and Driver test code