Refactory tests