Rewrote config handling