Extract preparing data code as a method to be overriden