Refactor [ci skip]
Fix lots of stuff [ci skip]