refactoring and adjusting setting