Some code improvements thanks to Thibault North remarks

Change-Id: I1b9fad99a949b730ba58ef37535e9455c9b09570
Signed-off-by: Aurélien PIERRE <aurelien@aurelienpierre.com>