Refactor errorContext in order to easy its usage