chore: refactoring and added source_metadata_extractor test