Removed code duplication in data end tag handlers