updated to use instancetype