#4, #5 - added templates and tests