minor refactor (moved "which goals are here" logic)
minor cleanup of body attribute value generation