optimaze page creation
no more globals