nicer logging and cleanup