Shorten the code a bit and remove TODO about getName.