factored out parser creation for hook