Switched from functions to a more flexible class with a namespace for better compatibility.