Moved data gathering to the model