Added Model Layer, and separated  View from Controller.