Refactor config parsing into own file