Remove buildErrorMessage function