plugins/jenkins: more refactors & util functions