high level refactoring