Moving has_children dynamic method creation into separated methods