Added some type definitions for clarity.