Clean-up some code