Changed db parsing and tweaked entity creation