refactored the directory