Code clean up for mainpage