Some restructuring
Introduce some kind of public api