refactor / improve renderer