Refactoring TupCanvas class