refactor prototype to have externalized render module