Separated logic for data frame handling into separate method.