Prettify and refactor

Primary must be first in ApplianceSet.all_appliances