modified template option in order to accept a string or function, updated docs accordingly