extract set_source_marker and set_target_marker functions