sparse gamma gap file refactoring