refactor invoice printer