optimized contentview code