bunch of shit before refactoring