Remove duplicated codes

Signed-off-by: Fabien Crassat <fabien@crassat.com>