Refactor canvas into seperate files