Enhanced settings functionality

this seems a bit weird, what does `db` actually refer to in this context?