Refactor settings, disconnect signals