small refactoring of code
more refactoring