refactored several require_a statements, for more informative error messages.