added BatchReturn type to Autosource + cleaned code