added more best practices to code templates and generated system actions, closes #829 and closes #830