clean up working code