callbacks + refactoring