minor refactoring and comment cleanup