Seems we need this check every time when calling processData(). Can we move those together to a separate method?