organize general functions into np_base.js