Add smooth link to anker and clean up the code