Cleaned up type input handler.