Refactored redundant code for converting from files to league_s structure into a common object file