refactor error messages partial to work for all models