code refactored using the helperSelectWord method