refined input parsing.