simplify class as function to deal with data transfer