common, master: Refactor Goal to simplify label counting

Change-Id: I8896d201daf5b60d3905a36b9b39c20fd574975d