Recapturing of lost encampments added, some refactoring