tried to make the db connection more modulare, not working / tested jet