Refactor Canvas class.