refactoring. added eshell, better window finding.