refactor the code director structure