adding collections functionality and unifying transform and classify patterns