Refactored for OOP design