refactor raise_errors_if_arguments_are_weird as per @rking advice