clear duplicated code