Restructured some template stuff