implementing serialzer class