Optimized getPageType()