optimize code  update ready etc