Moved gfx init to a more logical location