Starting refactoring with sample API