moving final helper function in to core