Refactor The Directory of lego