refactor code/separate html render on separate model