some cleanup and backwards compatibility.