Refactored and restructured.