cleaning up display code