Making helper function.