Input parsing functionality.