Making spark tasklet more generic