Speedup

Several speedups