Cleaned up a test helper method