mainly refactors