Added proto generation and consolidated some template retreival methods.