[TASK] Improve code quality

Change-Id: I82ac0f5117c8b8fee3555dfe036ed01f7201af0d
Reviewed-on: https://review.typo3.org/28012
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
[TESTS] Add more tests

Change-Id: I94e30adbef42db00e0c8bc75c4b15b673744ef2f
Reviewed-on: https://review.typo3.org/28013
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer