Split into several files

Separating interface from implementation