refactor folder organization and renaming stuff

general cleanup, no behaviour changed 
Now we should use `UnionCase` active patterns.