refactoring, now it looks fucking good