Split into library and implementation