clean up and link fixing