scoreWord/scoredWord-related cleanup and rewrite for clarity and ease of maintenance