Clean up code and purge output