refactored persistency to nodejs module