refactoring canvas to new control