upgrade some code