Minor code-cleanups and identifier renaming