improve GetData()

use smart pointer and array container