MOD is refactored with Z combinator