minor refactoring / var renaming