Use a static pointer cast for going up the hierarchy