Refactor module methods into instance methods for thread safetry.