logics returned as functions