change initializer to use callbacks