Duplicating code is not a great idea. Refactor this and move the recurring code into private method which takes the resultType as an additional argument.