attempt rewrite to use mongo