Changing class API to module