Settings moved to database
refactoring: encapsulation improvements