Refactor config structure