Refactored TextInputComponent.java