Refining input parsing