refactor some code
update