added more best practices to code templates and generated system actions, closes #910 and closes #911