fix copy-paste error
refactor rendering into controller