added unique index to few fields
moved Custom aggregate to common app