Refactoring assign and append.