added few new utils, refactor module pattern, optimise code