refactor using one mail controller for main page