some meh refactoring