Performance improvements

This fixes the performance to get total time back to 151 seconds