small refactoring and changes