Refactor Canvas to make it OO and easier to work with