minor refactoring and notes