Some refactorings and added append! methods.