Generic method to normalize objects