Rewrite config loading stuff