refactoring and stuff.