saving bachelor work, refactoring

small refactoring while writting