some more changes to td-populating logic