update pages & reduce codes