More code cleanups for gist commands