Refactor utilities into separate modules