made minor refactoring changes