refactor to service approach