Refatoring resource test