further template mods
minor performance enhancements to entity repository (at cost of error-checking...)