Minor code refactoring; added basic settings page