Refactor with Jersey framework.