[ES] Some code cleaning