Fix leader mapping
Eliminate some duplicate lines
Add a function and mess with some plugins