Refactor private helpers