refactors and stuff