initial code conversion to mvc