Code and directory reorganization