Added helper function to make it cleaner to define required objects.