refactored view from global scope into Canvas object