Refactored the CTD module.