Clean up, refactored