refactoring, using skeleton