small refactoring of assignment