added ability to use function as spec