clean up some code of mail view ctrl