Abstract error message creation a bit