refactoring curl service