tmp fixes performance improvments