Redesign has_relation template