this block can be astracted away.
see former mkdir_p impl in utils