Major revamp to match new codebase.