Shared code update and formatting