changing to mvc structure