added closure support

you may use closure to map target functions