Remove dublicated code