Prepared edit and delete links, minor optimizations.