Refactor one tiny function