Some small performance imprevements