Use guards instead of top-level `if`