refactored windows into controls