Refactored text drawing.