refactored removeDeadSlaves function in master
refactoring