Do some code cleanups