refactor rendering WIP