refactored display functionality