Fixing merge conflicts created when merging pull request issue #73

This fixes the merge conflicts not solved when merging pull request #73. The same files where modified on #73 and #72. I should have waited for #72 to get merged first as it was a big change. Or even possibly I shouldn't have sent that PR and do the formatting and optimising imports on smaller PR when fixing other issues.

@neomatrix369, if you are happy with this and everything goes fine this time, I think we could close #60.