Refactor canvas