refactor display function to use 'this'