refactored a lot :-)