Improve renderer state and some other things too