initial commit on template approach