Adapt some variable and function names to the common naming pattern
Refactor directory creation logic to be more readable