New work_detail.php page and some more optimizations