refactor viewer jsp