Heavy rearrangement of code and dirs.