code update and clean