apply some code cleanups