Remove dublicate code