Made all architectural changes to support npcs