rewrote the module using the newest API