bugfix and refactor viewer