clean up models code