code cleanups for incremental patches