Refactor

Some more refactoring.
Please do some live testing as I do not have any systems at hand to do it myself ;)