Major performance fix