cleanup, refactor core to use packages