Refactoring KWIC class