implement 3 arg and 4 arg API.