refactored has_manys, added some tests for plugins