Refactor the errors code slightly