preparing for multi datasource types handling

This PR is to prepare the engine for handling different datasource types. This is a quick big breaking change.