delet duplicated code