The logic of getting the parent should be in a different method. The need of the comment above the block of code is a good sign :-)