refactory tests