Is recursive implementation really needed here?