a bit o refactorin'