More refactoring, text rendering restored