viewer: code cleanup