Simplified directory creation code.