refactor window flags