Better separation of webGL and simulation