refactoring + corections des bugs