moved badly placed file
commit my self work
moved generic functions to module level