Moved handling of java.util.Collection out to it's own method