rpearce: Split common functions into a mixin