Refactoring

@hajoeichler for you to read before going to bed ;)