did minor refactoring