remove useless duplicated code