little optimizations and fix for "has_children" also would be added even if there's no children going to be rendered