queries rewritten to mongoose form, other smaller tweaks