Update and clean Model code