Refactoring the core to be easier to use with offline mode