Refactor code to add Utils file for commonly used generic functions