remove unneeded code duplications