Clean some duplication codes in models