Changed entitiy system to use data tables