Moved helper method into test methods