remove fetchall and write some tests