Adding better errors when factory creation fails