[helper] moved generic function outside the classes