Optimize tests