Refactoring

I'm using your awesome plugin for first time and it's great, thank you.
I need to make some customisation so I'm started to dive into source and find out that I can refractor some.
Hope you'll find this is convenient.

Minified version not included.