Refactor and add external renderer