PIM-2124: Fix method to get common attributes from family
PIM-2124: Indent method properly
PIM-2124: Fix SQL queries to get common attributes