Refactored spelling logic to its own class.