Rewrite from scratch
- new api for all stuff needed