Code refactoring - adding functions in utilites