Make more generic and adapt to new gfx functions.