Implemented nested sources, source factory

Implemented nested sources, source factory