moved all vars to config file and simplified db
moving functions to config class