user_id update and code cleanning