some minor refactoring, added settings class WIP