Changed config reading to a seperate function and now call this from the outside as well.