refactor words