Helper functions for op tree manipulation