refactored to separate datasource, parsingrules and 'added rules' from map