Moved duplication logic from models to views