refactor rest and dependencies