Code cleanup and Sagittarius shim