re-write "view" function, make it more readable, and make per-page theme really works