refactored errors partial