organized code by grouping into model and controller`