Refactored to match current code organization