slaves creation logic refactored