Input parsing reworked.