Add some traits to get DRYer

Change-Id: Ia18e1c4b77865c5ef123342b9e60305ec3cae2c2