Used function for same process