Cleaning the header and moving the anonymous actions to the correct place