mother of all refactors

It would be nice, if you approved my pull request