Extracted errors and action into separate modules.