more refactoring - about to change main page