Refactoring mkdir step