Add template for unary functions