refactor fmWindow