added advanced handling for rm_between and rm_bracket