Clean up some codes