delete duplicated code