new data structures & add invoice refactoring