large code cleanup for sCi integration