use instancetype instead of id wherever possible