Cleaned up the text input cache functionality