Refactoring lots of things in Canvas.ts into smaller functions.