Some refactoring

Signed-off-by: Ribesg <Ribesg@yahoo.fr>