Some clean-up and also introduced first improvements for sindex creation.