Graphics and code restructure