KiWi code cleanups