bf31fa0d03
Extracts inline logic into focused helper functions to bring each function under the complexity threshold. Fixes #445