incorporated refactoring into original file