I think this method should be divided in some submethods, one for each type of separator.