reformat model and all code