more code improvements

Remove unused variable, extract validation to method (@mattr-).
Do not require markup to be passed to parse_params as argument.