optimizing mainpage