Reworked config handler