Refactor code to make use of donor codes #173 

See #173