Better-organize the code for the error-handling and action-parsing.