refactor an unexported method