minor speepup improvements