cleaned up API and added render events