structuring my code in view render class