Refactor renderer and messages.