refactoring and more cleanup because im ocd perhaps