refactors variables