fixed \t text to 4 spaces; outsourced render state