Better padding management

Signed-off-by: pralonga <aurelien.pralong@gmail.com>