optimization for composing single functions with ID