refactor: use pure functions
6 files changed