put all function into one namespace, refactored (no jslins issues)