reorganized front page code-behind