Better refactor