Code refactoring fixes - related to directory creation