Moving close buttons, a little refactoring