refactoring display for unit test