refactoring topword