Allow passing functions as plugins for issue #30