Removes dublicate code