small refactoring code