Use model-view-controller pattern