Move tag publication to its own function