re-refactored

my original structure was on the right track