Moved some commands to event handlers