Added intermediate writer class toat uses stored procedures