Moved canvas code to its own class in src