Added best practices around optimization, security, and error handling from recent discussions