cleaned up canvas initialization and refreshment