Refact tests