refactor to privatize vars and funcs with _