Refactored spell checker a little