Refactored the directory struct