Shared functions and some of Part 1