Roll all functions into class to avoid namespace issues