Added callbacks and entityResolver logic