refactored reference words method