svg - canvas abstraction refactoring