Refactoring of PreviewCanvas