Minor refactor

Hi,
I am using this package and I decided to change some of the code, like using more than one core, flag configuration for the device id and for the filter expression, package name, error check.