Refactoring large chunks, trying to seperate decisions from simple state mechanics