optimize tests