# The Helmfile Best Practices Guide This guide covers the Helmfile’s considered patterns for writing advanced helmfiles. It focuses on how helmfile should be structured and executed. ## Missing keys and Default values helmfile tries its best to inform users for noticing potential mistakes. One example of how helmfile achieves it is that, `helmfile` fails when you tried to access missing keys in environment values. That is, the following example let `helmfile` fail when you have no `eventApi.replicas` defined in environment values. ``` {{ .Environment.Values.eventApi.replicas | default 1 }} ``` In case it isn't a mistake and you do want to allow missing keys, use the `getOrNil` template function: ``` {{ .Environment.Values | getOrNil "eventApi.replicas" }} ``` This result in printing `