refactor gpu2d