Factoring shared code into a 'shared' file