rewrite interace to save memory