refactoring enemy ecosystem and matter loss