add purpose labels (and refactor to make easier)