Organize display code and fix var names