Refactor active-workflows service