Initial rewrite
Remove old code
Rewrite