Clean up logic