move getSpec back to a function