Created a method for test to reduce repetition