improved prependTo/appendTo methods