general code clean up