Code review & cleanup, step 1: some renaming & reordering