remove dublicate code