refactored world state, split into multiple files.