Clean up des méthodes.
.last instead of [1]
Merge lines in generate_link