Refactoring. better window finding.