Refactored some things.

This is my first pull request ever.
I tried to test inside the vendor directory as a composer package.
I guess that is the wrong way to test/work/maintain a package.
What is the right way to do it?

Overall i refactored some things for cleaner code.