refactoring to deal with new PopBasis models and generic SED models