graphics: refactor