I don't like this at all. It is a copy-paste job that introduces code duplication. Let''s try and find a way to refactor "createDirectory" so that we don't need this code duplication.