Remove usage of prototype in toggle_link

This is a refactoring to gradually remove the usage of prototype from our codebase.