some code cleanups