Refatoring HelperFunction

stick to c++11