better solution for spec