refactored out model building to seperate class, container types handled correctly