converted writer to a class