re-factored persistence code to DAO layer preparing for mongodb support.