Shared code update, documentation and cleanup