[#30311] Move code from tag model to tags class