Refactor measure.attributes computing code out