move data check to own method