Clean up parts of code. Use bg canvas to improve performance.