Implemented templating in output library