Use dist as distro dir
Remove dead code, it did not complie and it was not used.
Add references to make it compile