a lot of other refactors