refactoring of librairy