loot refactor