a lot of refactors