Rework to split API from actual source