implementation of model view controller