more minor cleanups and variable renamings