refactoring File/Binary/Classes.hs