Update: some code cleanups