Added outside config for DB and reworked init