added optional template param