SAO code cleanup