Refactoring and spellling correction