Add option to disable local scan, code style clean up, small context obejct changes