code formatting and dialog height adjustment