Refactored error messages. tests all pass