adding optional callbacks everywhere, work in progress