remove dublicated code