Added settings.config and cleaned up SQL