refactor: define Render class and use it