clear duplicated code.