add binary version apply_lambda() and refactorings using it
use unnamed struct