move text rendering to Utils, add win state