supporting -exec, make it simpler

@pcworld suggestion