Updated as Node module for testing