small code and whitespace cleanup
tiny cleanup
move common code to AdvancedWordRepeatRule
whitespace cleanup only