Refactoring invoice-server