Move defer block parser into scripts