more OO friendly design and fixed back button browser issue