LPS-32431 Use the taglib to simplify logic and make it easier to maintain