Moved helper methods out to helper class for testing