some random refactors