functions for tag extraction