created a mainsettings page and some refactoring