refactor dialog layout