ODM code refactor and documentation