More template code with heavy influence by Pahimar