fix callback + refactoring