Move duplicate code to helper.
Fixed creation of member getter.