Move code from 'shared' files to common package