refactored nucleus to support adapters. needs to be tested again