more dynamic approach to pid parsing
cleanup, reorder, add limits