Refactor append/prepend/after/before