some settings tests and refactoring