Handling of closures (part 1, a lot of TODOs)