gearman refactor