so much refactoring my eyes want to bleed