I think these code duplications can be shortened