Major refactoring to support version 2 data-driven configuration