improving polymorphic relations, adding indexes migration and fixes