Adjusted sequence of events to be a bit more logical