Data collecting refactored