cleaned code for update