code cleanup, si fixes