Cleanup refactored