first attempts at refactoring pocket service.