refactored from lw_te to lw_view and mvc pattern