refactor curtain