Refactoring and adding options window