refactoring. Introduced EntityWindow