refactoring Freighter API