Extract ExtDirect utility

Signed-off-by: Alin Dreghiciu <adreghiciu@gmail.com>