changed sql script and started simplifying daos