refactors everything