enhance performances + remove non necessary code