Phase 3: integration and unit tests