Refactor rendering model

Refactor rendering model and widget to better follow mvc pattern.