Cleaned up some template stuff