some optimalisations