Moved helper function to the proper module