I would pull out the common parts after the if else statement. So the updateSizeEstimator is done on both branches... move it outside of the branch to prevent duplication.