refactor: introduce a helper